package com.share.spring;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * author:caifan
 * date:2019/5/12
 */
public class ApolloSpringDemo {

    public static void main(String[] args) {
        ApplicationContext ctx = new AnnotationConfigApplicationContext(AppConfig.class);
        AppConfig bean = ctx.getBean(AppConfig.class);
        System.out.println(bean.getConfig().config.getProperty("username", "root"));
        System.out.println(bean.getConfig().dbConfig.getProperty("jdbc.password", "root"));

    }
}
